#define  _CRT_SECURE_NO_WARNINGS
struct ListNode* detectCycle(struct ListNode* head)
{
    struct ListNode* slow = head;
    struct ListNode* fast = head;
    if (slow == NULL)
        return NULL;
    while (fast && fast->next)
    {
        fast = fast->next->next;
        slow = slow->next;
        if (fast == slow)
        {
            struct ListNode* meet = head;
            while (meet != slow)
            {
                meet = meet->next;
                slow = slow->next;
            }
            return meet;
        }
    }
    return NULL;
}